﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace NeonMika.EightTracks
{
    public class Set
    {
        /*
         *  <at-beginning>false</at-beginning>
    <at-end>false</at-end>
    <skip-allowed>true</skip-allowed>
    <track>
      <release-name>Justified</release-name>
      <faved-by-current-user>false</faved-by-current-user>
      <year nil="true"></year>
      <name>Rock Your Body</name>
      <play-duration>0</play-duration>
      <performer>Justin Timberlake</performer>
      <id>16952</id>
      <url>http://8tracks.s3.amazonaws.com/tf/000/016/952/Rock_Your_Body_mp3_887f6e637935be86c382.mp3</url>
    </track>
         * */

        bool at_beginning;

        public bool AtBeginning
        {
            get { return at_beginning; }
            set { at_beginning = value; }
        }

        bool at_end;

        public bool AtEnd
        {
            get { return at_end; }
            set { at_end = value; }
        }
        bool skip_allowed;

        public bool SkipAllowed
        {
            get { return skip_allowed; }
            set { skip_allowed = value; }
        }
        Track track;

        public Track Track
        {
            get { return track; }
            set { track = value; }
        }

        public Set(XElement xml)
        {
            AtBeginning = xml.TryGetBoolElement("at-beginning");
            AtEnd = xml.TryGetBoolElement("at-end");
            SkipAllowed = xml.TryGetBoolElement("skip-allowed");
            Track = new Track(xml.Element("track"));
        }
    }
}
